package com.mr.sell.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * Class: JsonUtil
 * User (作者):MRui
 * TODO (描述)：json转换工具类
 * Date 2018.09.25 23:23
 */
public class JsonUtil {
    /**
    * User (作者): MRui
    * TODO (描述)：转Json
    * Data：2018.09.25 23:25
    */
    public static String toJson(Object object){
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.setPrettyPrinting();
        Gson gson = gsonBuilder.create();
        return gson.toJson(object);
    }
}
